﻿using FoodEx.Dal.Repositories;
using FoodEx.Domain.Repositories;
using NUnit.Framework;

namespace FoodEx.Dal.UnitTests.Repositories
{
    [TestFixture]
    public class DummyRepositoryTestFixture
    {
        private IPatientRepository _patientRepository;

        [SetUp]
        public void SetUp()
        {
            _patientRepository = new DummyPatientRepository();
        }

        [Test]
        [TestCase("Home", 1)]
        [TestCase("Simpson", 3)]
        [TestCase("Simp", 3)]
        [TestCase("6666", 1)]
        [TestCase("9999999", 0)]
        public void WhenGettingPatientBySearchTerm(string searchTerm, int expectedNumberOfResults)
        {
            // Act
            var result = _patientRepository.GetPatientBySearchTerm(searchTerm);

            // Assert
            Assert.That(result.Count, Is.EqualTo(expectedNumberOfResults), "Unexpected number of results");
        }

        [Test]
        [TestCase("800", 3)]
        [TestCase("300", 0)]
        public void WhenGettingPatientsByCareUnit(string careUnit, int expectedNumberOfResults)
        {
            // Act
            var result = _patientRepository.GetPatientsByCareUnit(careUnit);

            // Assert
            Assert.That(result.Count, Is.EqualTo(expectedNumberOfResults), "Unexpected number of results");

        }
    }
}
